#include <cstdio>
using namespace std;

int n,t,a[200010],last;

int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	
	scanf("%d",&n);
	for(int i = 1;i <= n;i++) scanf("%d",&a[i]);
	
	a[0] = -1,t = n;
	while(t)
	{
		last = a[0];
		for(int i = 1;i <= n;i++)
		{
			if(a[i] == -1) continue;
			if(a[i] != last)
			{
				printf("%d ",i);
				last = a[i];
				a[i] = -1,t--;
			}
		}
		printf("\n");
	}
	
	return 0;
}
